{include file="public/header" /}

<!--<div class="wrapper wrapper-content">-->
<div class="row">
    <div class="col-sm-12">
        <div class="ibox float-e-margins">

            <div class="ibox-content">
                <form method="get" class="form-horizontal" id="form1">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">{:lang('admin')['Index-editusertype']}</label>
                        <div class="col-sm-10">
                            <select class="form-control m-b" name="userType">
                                <option value="0">{:lang('please select')}</option>
                                <option value="1">{:lang('normal user')}</option>
                                <option value="2">{:lang('airdrop user')}</option>
                            </select>
                        </div>
                    </div>
                    <input name="ids" value="{$ids}" type="hidden">

                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <div class="col-sm-4 col-sm-offset-2">
                            <button class="btn btn-primary" type="button" onclick="doSubmit()">{:lang('edit')}</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<!--</div>-->

{include file="public/footer" /}
<script>
    function doSubmit() {
        $.ajax({
            url: "{:U('Index/editUserType')}",
            type: 'post',
            data: $('#form1').serialize(),
            dataType: 'JSON',
            success: function (data) {
                if (data.status == 1) {
                    layer.msg(data.msg);
                    setTimeout(function () {
                        // location.reload();
                        parent.location.reload();
                    }, 1000)
                } else {
                    layer.msg(data.msg);
                }
            }
        });
        return false;
    }
</script>
